<!doctype html>
<!-- The DOCTYPE declaration above will set the    -->
<!-- browser's rendering engine into               -->
<!-- "Standards Mode". Replacing this declaration  -->
<!-- with a "Quirks Mode" doctype may lead to some -->
<!-- differences in layout.                        -->

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <!-- Add google calendar -->
	<script type="text/javascript" src="http://www.google.com/jsapi">
		google.load("gdata", "1.s");
		google.setOnLoadCallback(getMyFeed);
		
		/* 
		 * Create new calendar
		 */

		// Create the calendar service object
		var calendarService = new google.gdata.calendar.CalendarService('GoogleInc-jsguide-1.0');

		// The default "owncalendars" feed is used to insert calendar to the logged-in user
		var feedUri = 'http://www.google.com/calendar/feeds/default/owncalendars/full';

		// Create an instance of CalendarEntry, representing the new calendar
		var entry = new google.gdata.calendar.CalendarEntry();

		// Set the calendar title
		entry.setTitle(google.gdata.Text.create('JS-Client: insert calendar'));

		// Set the calendar summary
		var summary = new google.gdata.Text();
		summary.setText('This is a test calendar created by JS Client');
		entry.setSummary(summary);

		// Set the calendar timezone
		var timeZone = new google.gdata.calendar.TimeZoneProperty();
		timeZone.setValue('America/Los_Angeles');
		entry.setTimeZone(timeZone);

		// Set the calendar location
		var where = new google.gdata.Where();
		where.setLabel('Mountain View, CA');
		where.setValueString('Mountain View, CA');
		entry.addLocation(where);

		// Set the calendar to be visible in the Google Calendar UI
		var hidden = new google.gdata.calendar.HiddenProperty();
		hidden.setValue(false);
		entry.setHidden(hidden);

		// Set the color that represent this calendar in the Google Calendar UI
		var color = new google.gdata.calendar.ColorProperty();
		color.setValue('#2952A3');
		entry.setColor(color);

		// The callback method that will be called after a successful 
		// insertion from insertEntry()
		var callback = function(result) {
		  PRINT('calendar created!');
		}

		// Error handler will be invoked if there is an error from insertEntry()
		var handleError = function(error) {
		  PRINT(error);
		}

		// Submit the request using the calendar service object
		calendarService.insertEntry(feedUri, entry, callback, 
		    handleError, google.gdata.calendar.CalendarEntry);

	</script>
    <!--                                                               -->
    <!-- Consider inlining CSS to reduce the number of requested files -->
    <!--                                                               -->
    <link type="text/css" rel="stylesheet" href="GUoS.css">

    <!--                                           -->
    <!-- Any title is fine                         -->
    <!--                                           -->
    <title>Web Application Starter Project</title>
    
    <!--                                           -->
    <!-- This script loads your compiled module.   -->
    <!-- If you add any GWT meta tags, they must   -->
    <!-- be added before this line.                -->
    <!--                                           -->
    <script type="text/javascript" language="javascript" src="guos/guos.nocache.js"></script>
  </head>

  <!--                                           -->
  <!-- The body can have arbitrary html, or      -->
  <!-- you can leave the body empty if you want  -->
  <!-- to create a completely dynamic UI.        -->
  <!--                                           -->
  <body>

    <!-- OPTIONAL: include this if you want history support -->
    <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
    
    <!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
    <noscript>
      <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
        Your web browser must have JavaScript enabled
        in order for this application to display correctly.
      </div>
    </noscript>

    <h1>Web Application Starter Project</h1>


  </body>
</html>
